/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package test_system.questions;

/**
 *
 * @author root
 */
public class Answer {
    String answerBody;
    boolean right;
    
    public Answer(String answerBody, boolean right){
        this.answerBody = answerBody;
        this.right = right;
    }
    
    public Answer(String answerBody){
        this.answerBody = answerBody;
    }
    
    public boolean isRight(){
        return right;
    }
    
    public String toString(){
        return answerBody;
    }
    
    public String toWrite(){
        StringBuffer result = new StringBuffer();
        result.append(answerBody);
        result.append(":::");
        result.append(right);
        return result.toString();
    }
    
    public boolean equals(Answer answer){
        return answerBody.equals(answer.toString());
    }
    
}
